<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<html>
<head>
    <script type="text/javascript">
        function doSearch() {
        	grid.load({
                ins_cd: $('#ins_cd').val(),
                ins_cn_nm: $('#ins_cn_nm').val(),
                share_tp: $('#share_tp').val(),
                share_title: $('#share_title').val(),
                publish_st: $('#publish_st').val()
            });
        }
        /*新增*/
        function addShare(url){
            commonDetail(url,"save","shareTableId");
        }
        /* 修改*/
        function modifyShare(url){
            commonDetail(url,"update","shareTableId");
        }
        /* 发布*/
        function sharepublishSt1(url){
            asyncOper(url, "确定要发布吗");
        }
        /* 取消发布*/
        function sharepublishSt0(url){
        	asyncOper(url, "确定要取消发布吗");
        }
        var grid;
        $(document).ready(function() {
        	grid = $("#shareTableId").jpgrid({
                url: "shareListJson.do",
                columns: [
                    {title: "所属机构", field: "INST_NAME",width:180},
                    {title: "分享类型", field: "SHARE_TP",width:100},
                    {title: "标题", field: "SHARE_TITLE",width:100},
                    {title: "发布状态", field: "PUBLISH_ST",width:100},
                    {title: "发布时间", field: "PUBLISH_TS",width:100}
                ]
            });
        });
        
        function asyncOper(url, msg){
    		commonAsync(url, "shareTableId", msg, function(result){
    			grid.reload();
    		});
    	}
    </script>
</head>
<body class="easyui-layout list_body"  >
<form id="shareForm" name="shareForm">
    <div class="list_body_north" data-options="region:'north'"  border="false" >
        <!-- 查询表单 -->
        <div  class="datagrid-toolbar" border="false"  >
            <span>机构号:</span>
            <input id="ins_cd" type="text" name="ins_cd"  class="easyui-textbox"  >
            <span>机构名称:</span>
            <input id="ins_cn_nm" type="text" name="ins_cn_nm"  class="easyui-textbox"  >
            <span>分享类型:</span>
            <%--<input id="share_tp" type="text" name="share_tp"  class="easyui-textbox"  >--%>
            <code:codeSelect id="share_tp" name="share_tp"  code_type="share_tp" showSelect="true" selectId="${appMessageInfEntity.share_tp}"></code:codeSelect>
            <span>标题:</span>
            <input id="share_title" type="text" name="share_title"  class="easyui-textbox"  >
            <span>发布状态:</span>
            <code:codeSelect id="publish_st" name="publish_st"  code_type="publish_st" showSelect="true" selectId="${appMessageInfEntity.publish_st}"></code:codeSelect>
            <a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch() ">查询</a>
            <a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm() ">重置</a>
        </div>
        <!-- 自定义标签工具栏 -->
        <jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>
    </div>
    <div data-options="region:'center'" border="false"  class="list_body_center">
        <!-- 表格 -->
        <table id="shareTableId" fit="true"></table>
    </div>
</form>
</body>
</html>
